#include "acoes.h"

int CONTATEMP = 0;
char * ultimo_identificador_lido = NULL;
char * nome_variavel_retornada_por_expressao = NULL;
char buffer[200];
Stack * pilha_operandos = NULL;
Stack * pilha_operadores = NULL;

/**********************************************************************************************
Esta  rotina é uma  função  sem  retorno, não modifica nada no  compilador e não gera  código.
Esta é a rotina padrão executada em todas as transições de estados do APE que não possuem
rotinas semânticas definidas.
***********************************************************************************************/
void default_action() {
}

/*
 * Esta rotina empilha o ambiente de execução atual no Stack Frame, e cria um novo ambiente de
 * execução.
 */
void save_stack_frame() {
}

/**********************************************************************************************
Esta  rotina  cria  um  novo  escopo  (tabela  de  símbolos  aninhada  com  a  atual). Ela  é
utilizada quando um escopo é declarado no código  fonte, por exemplo entrando em um  laço ou em uma
área de comando condicional.
***********************************************************************************************/
void create_new_scope(){

	// cria nova tabela de simbolos dentro da atual
	SymbolTable * tabela = nova_tabela_de_simbolos();

	// cria links entre tabelas
	tabela->parent = current_symbol_table;
	current_symbol_table->child = tabela;

	// define a tabela criada como a atual
	current_symbol_table = tabela;

}

/**********************************************************************************************
Esta  rotina é chamada quando um  tipo está sendo declarado  (por exemplo, na ocorrência de
um tipo de dado como int, char ou bool).
***********************************************************************************************/
void declaring_type() {
	current_symbol_table->lines[current_symbol_table->nsimbolos].tipo_identificador = get_tipo_identificador(token.value);
}

/**********************************************************************************************
Esta  rotina  é  chamada  quando  uma  função  está  sendo  declarada.  Ela  atualiza  a  tabela  de
símbolos com o rótulo da função declarada. Caso o rótulo já exista na tabela de símbolos, uma
mensagem de erro é retornada.
***********************************************************************************************/
void declaring_function() {
	if (nome_do_identificador_eh_unico) {
		current_symbol_table->lines[current_symbol_table->nsimbolos].rotulo_ou_variavel = TIPO_ROTULO;
		current_symbol_table->lines[current_symbol_table->nsimbolos].nome_identificador = token.value;
		current_symbol_table->nsimbolos++;
	} else {
		jj_erro("declaracao de funcao incorreta");
	}
}

/**********************************************************************************************
Esta  rotina  é  chamada  quando  uma  variável  está  sendo  declarada. Ela  atualiza  a  tabela  de
símbolos com o nome do  identificador da variável. Caso o  identificador  já exista na  tabela de
símbolos, uma mensagem de erro é retornada.
***********************************************************************************************/
void declaring_variable() {
	if (nome_do_identificador_eh_unico) {
		current_symbol_table->lines[current_symbol_table->nsimbolos].rotulo_ou_variavel = TIPO_VARIAVEL;
		current_symbol_table->lines[current_symbol_table->nsimbolos].nome_identificador = token.value;
		current_symbol_table->nsimbolos++;
	} else {
		jj_erro("declaracao de variavel incorreta");
	}

}

/**********************************************************************************************
Esta  rotina  é  utilizada  para  armazenar  em  uma  variável  complementar  o  nome  de  um
identificador que receberá a atribuição de uma expressão.
***********************************************************************************************/
void comecando_atribuicao() {
	ultimo_identificador_lido = token.value;
}

/**********************************************************************************************
Esta rotina é executada para armazenar o nome da última variável retornada em um cálculo de
expressão.
***********************************************************************************************/
void definir_nome_da_variavel_retornada_por_expressao(char * nome) {
	nome_variavel_retornada_por_expressao = nome;
}

/**********************************************************************************************
Esta rotina é chamada depois que uma expressão é calculada, de maneira que gera o código
responsável por armazenar o resultado da expressão na variável correspondente à atribuição.
***********************************************************************************************/
void atribuicao_finalizada() {

	// LOAD
	write("\t\tLD\t");
	write(nome_variavel_retornada_por_expressao);
	write("\t; carrega constante ");
	write(token.value);
	write(" no acumulador\n");

	// MOVE
	write("\t\tMM\t");
	write(ultimo_identificador_lido);
	write("\t; armazena conteudo do acumulador na variavel ");
	write(ultimo_identificador_lido);
	write("\n");
}

// empilha (pilha de operandos, identificador encontrado)
void jj_expressao_1() {
	push_stack(&pilha_operandos, token.value);
}

// empilha (pilha de operandos, numero encontrado)
void jj_expressao_2() {
	write("passou aqui expressao 2");
	char * constante;
	sprintf(buffer, "K_%d", find_by_key(&table_numbers, token.value));
	constante = strcpy(buffer);
	push_stack(&pilha_operandos, constante);
	definir_nome_da_variavel_retornada_por_expressao(constante);
}

// empilha (pilha de operadores, "(")
void jj_expressao_3() {
	push_stack(&pilha_operadores, "(");
}

// nada executa
void jj_expressao_4() {
}

// X5:	consulta (pilha de operadores, Y);
//		Se Y != "(": executa GERACODIGO, detalhada adiante;. GO TO X5.
//		Se Y =	"(":	desempilha (pilha de operadores, Y);
void jj_expressao_5() {
	if (strcmp(consulta_pilha(pilha_operadores), "(") != 0) {
		jj_gera_codigo();
		jj_expressao_5();
	} else {
		pop_stack(&pilha_operadores);
	}
}

// X6:	consulta (pilha de operadores, Y);
//		Se Y for "+", "-", "*" ou "/":
//			executa GERACODIGO, detalhada adiante; GO TO X6;
//		Caso contrario: empilha (pilha de operadores, "+");
void jj_expressao_6() {
	if (strcmp(consulta_pilha(pilha_operadores), "+") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "-") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "*") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "/") == 0) {
		jj_gera_codigo();
		jj_expressao_6();
	} else {
		push_stack(&pilha_operadores, "+");
	}
}

// X7:	consulta (pilha de operadores, Y);
//		Se Y for "+", "-", "*" ou "/":
//			executa GERACODIGO, detalhada adiante; GO TO X7;
//		Caso contrario: empilha (pilha de operadores, "-");
void jj_expressao_7() {
	if (strcmp(consulta_pilha(pilha_operadores), "+") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "-") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "*") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "/") == 0) {
		jj_gera_codigo();
		jj_expressao_7();
	} else {
		push_stack(&pilha_operadores, "-");
	}
}

// X8:	consulta (pilha de operadores, Y);
//		Se Y for "*" ou "/": executa GERACODIGO, detalhada adiante; GO TO X8;
//		Caso contrario: empilha (pilha de operadores, "*");
void jj_expressao_8() {
	if (strcmp(consulta_pilha(pilha_operadores), "*") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "/") == 0) {
		jj_gera_codigo();
		jj_expressao_8();
	} else {
		push_stack(&pilha_operadores, "*");
	}
}

// X9:	consulta (pilha de operadores, Y);
//		Se Y for "*" ou "/": executa GERACODIGO, detalhada adiante; GO TO X9;
//		Caso contrario: empilha (pilha de operadores, "/");
void jj_expressao_9() {
	write("passou aqui");
	if (strcmp(consulta_pilha(pilha_operadores), "*") == 0 ||
		strcmp(consulta_pilha(pilha_operadores), "/") == 0) {
		jj_gera_codigo();
		jj_expressao_9();
	} else {
		push_stack(&pilha_operadores, "/");
	}
}

// (* Esta rotina eh associada ao final do reconhecimento da expressao *)
// X10:	consulta (pilha de operadores, Y);
//		Se Y nao for "vazio" : executa GERACODIGO, detalhada adiante, GO TO X10;
void jj_expressao_10() {
	if (pilha_operadores != NULL) {
		jj_gera_codigo();
		jj_expressao_10();
	}
}

void jj_expressao_11() {
	jj_erro("esperava-se identificador, numero ou '(' neste ponto");
}
void jj_expressao_12() {
	jj_erro("esperava-se uma expressao correta neste ponto");
}
void jj_expressao_13() {
	jj_erro("esperava-se ')' neste ponto");
}

/*****************************************************************************
Ela  é  responsável  por  gerar  os  códigos  de  cálculo  da
expressão.

GERACODIGO:	Desempilha (pilha de operadores, Y);
				Desempilha (pilha de operandos, B);
				Desempilha (pilha de operandos, A);
				Gera ("LDA", A);
				Se Y = "+": gera("ADA", B);
				Se Y = "-": gera("SUB", B);
     			Se Y = "*": gera("MUL", B);
				Se Y = "/": gera("DIV", B);
				Incrementacontador(CONTATEMP);
				Gera("STA", "#TEMP".CONTATEMP);
				empilha(pilha de operandos, "#TEMP".CONTATEMP);
 *****************************************************************************/
void jj_gera_codigo() {
	write("isso eh o geracodigo");
	CONTATEMP++;

	char * Y = pop_stack(&pilha_operadores); // desempilha (pilha de operadores, Y)
	char * B = pop_stack(&pilha_operandos); // desempilha (pilha de operandos, B)
	char * A = pop_stack(&pilha_operandos); // desempilha (pilha de operandos, A)

	sprintf(buffer, "AC = %s", A);
	jj_gera("LD", A, buffer); //(jj_gera(LD, A) - deposita A no acumulador)

	sprintf(buffer, "AC = AC%s%s", Y, B);
	jj_gera(Y, B, buffer);

	sprintf(buffer, "TEMP%d", CONTATEMP);

	jj_gera("MM", buffer, "TEMPX = AC");

	push_stack(&pilha_operandos, strcpy(buffer));
	definir_nome_da_variavel_retornada_por_expressao(strcpy(buffer));
}

/******************************************************************************************************************
 Ela é  responsável por gerar o código de uma operação em MVN.
 GERA(X,Y):	Esta rotina deve limitar-se a emitir, em um dispositivo de saiida, a lista de variaveis fornecidas.
				O primeiro parametro eh o mnemonico da instrucao gerada, e o segundo eh o operando. Note-se que, em
				alguns casos, o operando aparece na forma P.Q., designando a concatenacao das cadeias de caracteres
				P e Q, nesta ordem.
 *******************************************************************************************************************/
void jj_gera(char * x, char * y, char *c) {
	write("\t\t");
	write(x);
	write("\t\t");
	write(y);
	write("\t\t;\t");
	write(c);
	write("\n");
	write("isso eh o jj gera");
}

/*
 * Esta rotina deve imprimir a mensagem X passada como parametro, e contabilizar os erros ocorridos.
 */
void jj_erro(char * erro) {
	printf("\nchamando funcao: jj_erro\n");
	sprintf(buffer, "ERRO SEMANTICO: %s", erro);
	fputs(buffer, stderr);
	semantic_error++;
}


void write_variables() {
	int i;
	SymbolLine line;

	write("\t\t#\tmain\n\t\tHM /0\n\n\n\t\t@\t/200\t; comeco da area de dados\n");

	//TODO: navegar em todas as tabelas de simbolo do stack frame

	// Declaracao de variaveis
	while (current_symbol_table->parent != NULL) {
		current_symbol_table = current_symbol_table->parent;
	}

	while (current_symbol_table != NULL) {

		for (i=0; i < current_symbol_table->nsimbolos; i++) {

			if (current_symbol_table->lines[i].rotulo_ou_variavel == 1) {

				line = current_symbol_table->lines[i];

				sprintf(buffer, "%d", line.valor_inteiro);

				write(line.nome_identificador);
				write("\t\tK\t\t=");
				write(buffer);
				write("\t; declaracao da variavel ");
				write(line.nome_identificador);
				write("\n");
			}

		}

		current_symbol_table = current_symbol_table->child;

	}

	// Declaracao de constantes inteiras

	linked_table * temp_line = &table_numbers;

	while (temp_line != NULL) {
		write("K_");
		sprintf(buffer, "%d", temp_line->value);
		write(buffer);
		write("\t\tK\t\t=");
		write(temp_line->key);
		write(" ; declaracao da constante K_");
		write(buffer);
		write("\n");
		temp_line = temp_line->next;
	}

	// Declaracao de variaveis temporarias
	for (i=1; i <= CONTATEMP; i++) {
		write("TEMP");
		sprintf(buffer, "%d", i);
		write(buffer);
		write("\t\tK\t\t=0");
		write(" ; declaracao da variavel temporaria TEMP");
		write(buffer);
		write("\n");
	}

}

// Verifica se o identificador ainda nao esta presente na tabela de simbolos
int nome_do_identificador_eh_unico() {
	return pesquisa_posicao_na_tabela_de_simbolos(current_symbol_table, token.value) == 0;
}


//////////////////////////////////////////////////////////
////////// GENERATED BY RADIANT FIRE LOADER //////////////
//////////////////////////////////////////////////////////
/*
 * Esta  rotina  inicializa vetores de  funções que serão acionados para cada  transição que o APE realizar.
 */
void init_semantic_actions() {

	/* Machine 0: elemento */

	/* token transitions */
	semantic_functions_tokens 		 [0][0][APE_TOKEN_FUNCAO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][0][APE_TOKEN_PROCEDIMENTO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][0][APE_TOKEN_PROGRAMA_ID]		=		default_action;
	semantic_functions_tokens 		 [0][0][APE_TOKEN_REGISTRO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][1][APE_TOKEN_IDENTIFICADOR_ID]		=		declaring_function; //declaração nome da função
	semantic_functions_tokens 		 [0][2][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][3][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][4][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][5][APE_TOKEN_ABRE_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][6][APE_TOKEN_EH_ID]		=		default_action;
	semantic_functions_tokens 		 [0][7][APE_TOKEN_BOOLEANO_ID]		=		declaring_type;
	semantic_functions_tokens 		 [0][7][APE_TOKEN_FECHA_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][7][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][7][APE_TOKEN_INTEIRO_ID]		=		declaring_type;
	semantic_functions_tokens 		 [0][7][APE_TOKEN_REAL_ID]		=		declaring_type;
	semantic_functions_tokens 		 [0][7][APE_TOKEN_STRING_ID]		=		declaring_type;
	semantic_functions_tokens 		 [0][8][APE_TOKEN_INICIO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][9][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][9][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][10][APE_TOKEN_EH_ID]		=		default_action;
	semantic_functions_tokens 		 [0][11][APE_TOKEN_FIM_ID]		=		default_action;
	semantic_functions_tokens 		 [0][12][APE_TOKEN_RETORNA_ID]		=		default_action;
	semantic_functions_tokens 		 [0][15][APE_TOKEN_INICIO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][16][APE_TOKEN_FIM_ID]		=		default_action;
	semantic_functions_tokens 		 [0][17][APE_TOKEN_INICIO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][18][APE_TOKEN_FIMREGISTRO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][19][APE_TOKEN_FECHA_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][19][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [0][20][APE_TOKEN_NUMERO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][21][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][22][APE_TOKEN_ABRE_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][23][APE_TOKEN_BOOLEANO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][23][APE_TOKEN_FECHA_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][23][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][23][APE_TOKEN_INTEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][23][APE_TOKEN_REAL_ID]		=		default_action;
	semantic_functions_tokens 		 [0][23][APE_TOKEN_STRING_ID]		=		default_action;
	semantic_functions_tokens 		 [0][24][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][24][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][25][APE_TOKEN_EH_ID]		=		default_action;
	semantic_functions_tokens 		 [0][26][APE_TOKEN_BOOLEANO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][26][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][26][APE_TOKEN_INTEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][26][APE_TOKEN_REAL_ID]		=		default_action;
	semantic_functions_tokens 		 [0][26][APE_TOKEN_STRING_ID]		=		default_action;
	semantic_functions_tokens 		 [0][27][APE_TOKEN_INICIO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][28][APE_TOKEN_FIM_ID]		=		default_action;
	semantic_functions_tokens 		 [0][29][APE_TOKEN_FECHA_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][29][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [0][30][APE_TOKEN_NUMERO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][31][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [0][32][APE_TOKEN_BOOLEANO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][32][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [0][32][APE_TOKEN_INTEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [0][32][APE_TOKEN_REAL_ID]		=		default_action;
	semantic_functions_tokens 		 [0][32][APE_TOKEN_STRING_ID]		=		default_action;

	/* machine transitions */
	semantic_functions_machines 		 [0][8][APE_MACHINE_DECLARACAO_ID]		=		default_action;
	semantic_functions_machines 		 [0][11][APE_MACHINE_COMANDO_ID]		=		default_action;
	semantic_functions_machines 		 [0][12][APE_MACHINE_DECLARACAO_ID]		=		default_action;
	semantic_functions_machines 		 [0][14][APE_MACHINE_DECLARACAO_ID]		=		default_action;
	semantic_functions_machines 		 [0][16][APE_MACHINE_COMANDO_ID]		=		default_action;
	semantic_functions_machines 		 [0][18][APE_MACHINE_DECLARACAO_ID]		=		default_action;
	semantic_functions_machines 		 [0][27][APE_MACHINE_DECLARACAO_ID]		=		default_action;
	semantic_functions_machines 		 [0][28][APE_MACHINE_COMANDO_ID]		=		default_action;

	/* acoes semanticas de saida */
	semantic_funcions_saida 		 [0][0]		=		default_action;
	semantic_funcions_saida 		 [0][1]		=		default_action;
	semantic_funcions_saida 		 [0][2]		=		default_action;
	semantic_funcions_saida 		 [0][3]		=		default_action;
	semantic_funcions_saida 		 [0][4]		=		default_action;
	semantic_funcions_saida 		 [0][5]		=		default_action;
	semantic_funcions_saida 		 [0][6]		=		default_action;
	semantic_funcions_saida 		 [0][7]		=		default_action;
	semantic_funcions_saida 		 [0][8]		=		default_action;
	semantic_funcions_saida 		 [0][9]		=		default_action;
	semantic_funcions_saida 		 [0][10]		=		default_action;
	semantic_funcions_saida 		 [0][11]		=		default_action;
	semantic_funcions_saida 		 [0][12]		=		default_action;
	semantic_funcions_saida 		 [0][13]		=		default_action;
	semantic_funcions_saida 		 [0][14]		=		default_action;
	semantic_funcions_saida 		 [0][15]		=		default_action;
	semantic_funcions_saida 		 [0][16]		=		default_action;
	semantic_funcions_saida 		 [0][17]		=		default_action;
	semantic_funcions_saida 		 [0][18]		=		default_action;
	semantic_funcions_saida 		 [0][19]		=		default_action;
	semantic_funcions_saida 		 [0][20]		=		default_action;
	semantic_funcions_saida 		 [0][21]		=		default_action;
	semantic_funcions_saida 		 [0][22]		=		default_action;
	semantic_funcions_saida 		 [0][23]		=		default_action;
	semantic_funcions_saida 		 [0][24]		=		default_action;
	semantic_funcions_saida 		 [0][25]		=		default_action;
	semantic_funcions_saida 		 [0][26]		=		default_action;
	semantic_funcions_saida 		 [0][27]		=		default_action;
	semantic_funcions_saida 		 [0][28]		=		default_action;
	semantic_funcions_saida 		 [0][29]		=		default_action;
	semantic_funcions_saida 		 [0][30]		=		default_action;
	semantic_funcions_saida 		 [0][31]		=		default_action;
	semantic_funcions_saida 		 [0][32]		=		default_action;

	/* Machine 1: declaracao */

	/* token transitions */
	semantic_functions_tokens 		 [1][0][APE_TOKEN_BOOLEANO_ID]		=		default_action;
	semantic_functions_tokens 		 [1][0][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [1][0][APE_TOKEN_INTEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [1][0][APE_TOKEN_REAL_ID]		=		default_action;
	semantic_functions_tokens 		 [1][0][APE_TOKEN_STRING_ID]		=		default_action;
	semantic_functions_tokens 		 [1][1][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [1][1][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [1][2][APE_TOKEN_ATRIBUICAO_ID]		=		default_action;
	semantic_functions_tokens 		 [1][2][APE_TOKEN_PONTO_E_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [1][3][APE_TOKEN_NUMERO_ID]		=		default_action;
	semantic_functions_tokens 		 [1][4][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [1][7][APE_TOKEN_PONTO_E_VIRGULA_ID]		=		default_action;

	/* machine transitions */
	semantic_functions_machines 		 [1][5][APE_MACHINE_EXPRESSAO_ID]		=		default_action;

	/* acoes semanticas de saida */
	semantic_funcions_saida 		 [1][0]		=		default_action;
	semantic_funcions_saida 		 [1][1]		=		default_action;
	semantic_funcions_saida 		 [1][2]		=		default_action;
	semantic_funcions_saida 		 [1][3]		=		default_action;
	semantic_funcions_saida 		 [1][4]		=		default_action;
	semantic_funcions_saida 		 [1][5]		=		default_action;
	semantic_funcions_saida 		 [1][6]		=		default_action;
	semantic_funcions_saida 		 [1][7]		=		default_action;

	/* Machine 2: comando */

	/* token transitions */
	semantic_functions_tokens 		 [2][0][APE_TOKEN_ENQUANTO_ID]		=		default_action;
	semantic_functions_tokens 		 [2][0][APE_TOKEN_ENTRADA_ID]		=		default_action;
	semantic_functions_tokens 		 [2][0][APE_TOKEN_IDENTIFICADOR_ID]		=		comecando_atribuicao;
	semantic_functions_tokens 		 [2][0][APE_TOKEN_SAIDA_ID]		=		default_action;
	semantic_functions_tokens 		 [2][0][APE_TOKEN_SE_ID]		=		default_action;
	semantic_functions_tokens 		 [2][1][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [2][1][APE_TOKEN_ABRE_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [2][1][APE_TOKEN_ATRIBUICAO_ID]		=		default_action;
	semantic_functions_tokens 		 [2][4][APE_TOKEN_IDENTIFICADOR_ID]		=		default_action;
	semantic_functions_tokens 		 [2][6][APE_TOKEN_NUMERO_ID]		=		default_action;
	semantic_functions_tokens 		 [2][7][APE_TOKEN_FECHA_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [2][8][APE_TOKEN_PONTO_E_VIRGULA_ID]		=		atribuicao_finalizada;
	semantic_functions_tokens 		 [2][9][APE_TOKEN_FECHA_PARENTESES_ID]		=		default_action;
	semantic_functions_tokens 		 [2][9][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [2][12][APE_TOKEN_LOOP_ID]		=		default_action;
	semantic_functions_tokens 		 [2][13][APE_TOKEN_FIMLOOP_ID]		=		default_action;
	semantic_functions_tokens 		 [2][14][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [2][15][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [2][15][APE_TOKEN_ATRIBUICAO_ID]		=		default_action;
	semantic_functions_tokens 		 [2][16][APE_TOKEN_ENTAO_ID]		=		default_action;
	semantic_functions_tokens 		 [2][17][APE_TOKEN_FIMSE_ID]		=		default_action;
	semantic_functions_tokens 		 [2][17][APE_TOKEN_SENAOSE_ID]		=		default_action;
	semantic_functions_tokens 		 [2][17][APE_TOKEN_SENAO_ID]		=		default_action;
	semantic_functions_tokens 		 [2][18][APE_TOKEN_FIMSE_ID]		=		default_action;

	/* machine transitions */
	semantic_functions_machines 		 [2][2][APE_MACHINE_EXPRESSAO_ID]		=		default_action;
	semantic_functions_machines 		 [2][3][APE_MACHINE_EXPRESSAO_ID]		=		default_action;
	semantic_functions_machines 		 [2][5][APE_MACHINE_EXPRESSAO_ID]		=		default_action;
	semantic_functions_machines 		 [2][7][APE_MACHINE_EXPRESSAO_ID]		=		default_action;
	semantic_functions_machines 		 [2][11][APE_MACHINE_EXPRESSAO_ID]		=		default_action;
	semantic_functions_machines 		 [2][13][APE_MACHINE_COMANDO_ID]		=		default_action;
	semantic_functions_machines 		 [2][17][APE_MACHINE_COMANDO_ID]		=		default_action;
	semantic_functions_machines 		 [2][18][APE_MACHINE_COMANDO_ID]		=		default_action;

	/* acoes semanticas de saida */
	semantic_funcions_saida 		 [2][0]		=		default_action;
	semantic_funcions_saida 		 [2][1]		=		default_action;
	semantic_funcions_saida 		 [2][2]		=		default_action;
	semantic_funcions_saida 		 [2][3]		=		default_action;
	semantic_funcions_saida 		 [2][4]		=		default_action;
	semantic_funcions_saida 		 [2][5]		=		default_action;
	semantic_funcions_saida 		 [2][6]		=		default_action;
	semantic_funcions_saida 		 [2][7]		=		default_action;
	semantic_funcions_saida 		 [2][8]		=		default_action;
	semantic_funcions_saida 		 [2][9]		=		default_action;
	semantic_funcions_saida 		 [2][10]		=		default_action;
	semantic_funcions_saida 		 [2][11]		=		default_action;
	semantic_funcions_saida 		 [2][12]		=		default_action;
	semantic_funcions_saida 		 [2][13]		=		default_action;
	semantic_funcions_saida 		 [2][14]		=		default_action;
	semantic_funcions_saida 		 [2][15]		=		default_action;
	semantic_funcions_saida 		 [2][16]		=		default_action;
	semantic_funcions_saida 		 [2][17]		=		default_action;
	semantic_funcions_saida 		 [2][18]		=		default_action;

	/* Machine 3: expressao */

	/* token transitions */
	semantic_functions_tokens 		 [3][0][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][0][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][0][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][0][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][0][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][0][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][0][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][0][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][1][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][1][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][1][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][1][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][1][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][1][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][2][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][2][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][4][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][5][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][5][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][5][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][5][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][5][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][5][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][6][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][6][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][6][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][6][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][6][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][6][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][7][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][7][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][8][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][8][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][9][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][9][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][10][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][10][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][10][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][10][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][10][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][10][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][11][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][11][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][13][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][14][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][15][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][16][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][16][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][17][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][18][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][18][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][18][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][18][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][18][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][18][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][19][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][19][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][19][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][19][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][19][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][19][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][19][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][21][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][21][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][21][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][21][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][21][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][22][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][23][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][23][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][23][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][23][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][23][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][23][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][25][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][25][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][27][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][28][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][29][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][30][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][31][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][32][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][32][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][32][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][32][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][32][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][32][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][33][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][33][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][35][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][36][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][36][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][38][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][39][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][40][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][41][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][42][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][43][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][43][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][45][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][45][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][46][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][47][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][48][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][48][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][49][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][50][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][50][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][50][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][50][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][50][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][50][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][51][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][51][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][51][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][51][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][51][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][51][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][52][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][52][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][53][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][53][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][53][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][53][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][53][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][53][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][54][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][54][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][54][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][54][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][54][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][54][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][54][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][56][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][56][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][56][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][56][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][56][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][57][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][57][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][57][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][57][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][57][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][57][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][59][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][60][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][61][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][62][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][63][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][63][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][63][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][63][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][63][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][63][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][64][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][64][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][66][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][67][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][68][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][69][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][70][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][71][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][71][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][73][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][74][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_MULTIPLICACAO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][74][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][76][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][77][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][77][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][79][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][80][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][81][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][82][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][83][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][84][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][84][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][86][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][87][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][88][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][89][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_DIFERENTE_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_MAIOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_MAIOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_MENOR_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_MENOR_IGUAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][90][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][91][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][91][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][93][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][93][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][93][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][93][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][93][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][93][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][94][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][94][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][96][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][96][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][96][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][96][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][96][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][96][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][97][APE_TOKEN_ABRE_PARENTESES_ID]		=		jj_expressao_3; /*abre parenteses*/
	semantic_functions_tokens 		 [3][97][APE_TOKEN_FALSO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][97][APE_TOKEN_IDENTIFICADOR_ID]		=		jj_expressao_1;
	semantic_functions_tokens 		 [3][97][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][97][APE_TOKEN_STRINGLITERAL_ID]		=		default_action;
	semantic_functions_tokens 		 [3][97][APE_TOKEN_VERDADEIRO_ID]		=		default_action;
	semantic_functions_tokens 		 [3][99][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][100][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][101][APE_TOKEN_NUMERO_ID]		=		jj_expressao_2;
	semantic_functions_tokens 		 [3][102][APE_TOKEN_FECHA_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_ABRE_COLCHETES_ID]		=		default_action;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_DIVISAO_ID]		=		jj_expressao_9;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_E_ID]		=		default_action;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_MULTIPLICACAO_ID]		=		jj_expressao_8;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_OU_ID]		=		default_action;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_SOMA_ID]		=		jj_expressao_6;
	semantic_functions_tokens 		 [3][103][APE_TOKEN_SUBTRACAO_ID]		=		jj_expressao_7;
	semantic_functions_tokens 		 [3][104][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;
	semantic_functions_tokens 		 [3][104][APE_TOKEN_VIRGULA_ID]		=		default_action;
	semantic_functions_tokens 		 [3][107][APE_TOKEN_FECHA_PARENTESES_ID]		=		jj_expressao_5;

	/* machine transitions */
	semantic_functions_machines 		 [3][3][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][12][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][14][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][20][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][24][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][26][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][29][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][34][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][37][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][39][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][44][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][46][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][55][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][58][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][60][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][65][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][67][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][72][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][75][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][78][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][80][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][85][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][87][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][92][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][95][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][98][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][100][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][105][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;
	semantic_functions_machines 		 [3][106][APE_MACHINE_EXPRESSAO_ID]		=		jj_expressao_4;

	/* acoes semanticas de saida */
	semantic_funcions_saida 		 [3][0]		=		default_action;
	semantic_funcions_saida 		 [3][1]		=		default_action;
	semantic_funcions_saida 		 [3][2]		=		default_action;
	semantic_funcions_saida 		 [3][3]		=		default_action;
	semantic_funcions_saida 		 [3][4]		=		default_action;
	semantic_funcions_saida 		 [3][5]		=		default_action;
	semantic_funcions_saida 		 [3][6]		=		default_action;
	semantic_funcions_saida 		 [3][7]		=		default_action;
	semantic_funcions_saida 		 [3][8]		=		default_action;
	semantic_funcions_saida 		 [3][9]		=		default_action;
	semantic_funcions_saida 		 [3][10]		=		default_action;
	semantic_funcions_saida 		 [3][11]		=		default_action;
	semantic_funcions_saida 		 [3][12]		=		default_action;
	semantic_funcions_saida 		 [3][13]		=		default_action;
	semantic_funcions_saida 		 [3][14]		=		default_action;
	semantic_funcions_saida 		 [3][15]		=		default_action;
	semantic_funcions_saida 		 [3][16]		=		default_action;
	semantic_funcions_saida 		 [3][17]		=		default_action;
	semantic_funcions_saida 		 [3][18]		=		default_action;
	semantic_funcions_saida 		 [3][19]		=		default_action;
	semantic_funcions_saida 		 [3][20]		=		default_action;
	semantic_funcions_saida 		 [3][21]		=		default_action;
	semantic_funcions_saida 		 [3][22]		=		default_action;
	semantic_funcions_saida 		 [3][23]		=		default_action;
	semantic_funcions_saida 		 [3][24]		=		default_action;
	semantic_funcions_saida 		 [3][25]		=		default_action;
	semantic_funcions_saida 		 [3][26]		=		default_action;
	semantic_funcions_saida 		 [3][27]		=		default_action;
	semantic_funcions_saida 		 [3][28]		=		default_action;
	semantic_funcions_saida 		 [3][29]		=		default_action;
	semantic_funcions_saida 		 [3][30]		=		default_action;
	semantic_funcions_saida 		 [3][31]		=		default_action;
	semantic_funcions_saida 		 [3][32]		=		default_action;
	semantic_funcions_saida 		 [3][33]		=		default_action;
	semantic_funcions_saida 		 [3][34]		=		default_action;
	semantic_funcions_saida 		 [3][35]		=		default_action;
	semantic_funcions_saida 		 [3][36]		=		default_action;
	semantic_funcions_saida 		 [3][37]		=		default_action;
	semantic_funcions_saida 		 [3][38]		=		default_action;
	semantic_funcions_saida 		 [3][39]		=		default_action;
	semantic_funcions_saida 		 [3][40]		=		default_action;
	semantic_funcions_saida 		 [3][41]		=		default_action;
	semantic_funcions_saida 		 [3][42]		=		default_action;
	semantic_funcions_saida 		 [3][43]		=		default_action;
	semantic_funcions_saida 		 [3][44]		=		default_action;
	semantic_funcions_saida 		 [3][45]		=		default_action;
	semantic_funcions_saida 		 [3][46]		=		default_action;
	semantic_funcions_saida 		 [3][47]		=		default_action;
	semantic_funcions_saida 		 [3][48]		=		default_action;
	semantic_funcions_saida 		 [3][49]		=		default_action;
	semantic_funcions_saida 		 [3][50]		=		default_action;
	semantic_funcions_saida 		 [3][51]		=		default_action;
	semantic_funcions_saida 		 [3][52]		=		default_action;
	semantic_funcions_saida 		 [3][53]		=		default_action;
	semantic_funcions_saida 		 [3][54]		=		default_action;
	semantic_funcions_saida 		 [3][55]		=		default_action;
	semantic_funcions_saida 		 [3][56]		=		default_action;
	semantic_funcions_saida 		 [3][57]		=		default_action;
	semantic_funcions_saida 		 [3][58]		=		default_action;
	semantic_funcions_saida 		 [3][59]		=		default_action;
	semantic_funcions_saida 		 [3][60]		=		default_action;
	semantic_funcions_saida 		 [3][61]		=		default_action;
	semantic_funcions_saida 		 [3][62]		=		default_action;
	semantic_funcions_saida 		 [3][63]		=		default_action;
	semantic_funcions_saida 		 [3][64]		=		default_action;
	semantic_funcions_saida 		 [3][65]		=		default_action;
	semantic_funcions_saida 		 [3][66]		=		default_action;
	semantic_funcions_saida 		 [3][67]		=		default_action;
	semantic_funcions_saida 		 [3][68]		=		default_action;
	semantic_funcions_saida 		 [3][69]		=		default_action;
	semantic_funcions_saida 		 [3][70]		=		default_action;
	semantic_funcions_saida 		 [3][71]		=		default_action;
	semantic_funcions_saida 		 [3][72]		=		default_action;
	semantic_funcions_saida 		 [3][73]		=		default_action;
	semantic_funcions_saida 		 [3][74]		=		default_action;
	semantic_funcions_saida 		 [3][75]		=		default_action;
	semantic_funcions_saida 		 [3][76]		=		default_action;
	semantic_funcions_saida 		 [3][77]		=		default_action;
	semantic_funcions_saida 		 [3][78]		=		default_action;
	semantic_funcions_saida 		 [3][79]		=		default_action;
	semantic_funcions_saida 		 [3][80]		=		default_action;
	semantic_funcions_saida 		 [3][81]		=		default_action;
	semantic_funcions_saida 		 [3][82]		=		default_action;
	semantic_funcions_saida 		 [3][83]		=		default_action;
	semantic_funcions_saida 		 [3][84]		=		default_action;
	semantic_funcions_saida 		 [3][85]		=		default_action;
	semantic_funcions_saida 		 [3][86]		=		default_action;
	semantic_funcions_saida 		 [3][87]		=		default_action;
	semantic_funcions_saida 		 [3][88]		=		default_action;
	semantic_funcions_saida 		 [3][89]		=		default_action;
	semantic_funcions_saida 		 [3][90]		=		default_action;
	semantic_funcions_saida 		 [3][91]		=		default_action;
	semantic_funcions_saida 		 [3][92]		=		default_action;
	semantic_funcions_saida 		 [3][93]		=		default_action;
	semantic_funcions_saida 		 [3][94]		=		default_action;
	semantic_funcions_saida 		 [3][95]		=		default_action;
	semantic_funcions_saida 		 [3][96]		=		default_action;
	semantic_funcions_saida 		 [3][97]		=		default_action;
	semantic_funcions_saida 		 [3][98]		=		default_action;
	semantic_funcions_saida 		 [3][99]		=		default_action;
	semantic_funcions_saida 		 [3][100]		=		default_action;
	semantic_funcions_saida 		 [3][101]		=		default_action;
	semantic_funcions_saida 		 [3][102]		=		default_action;
	semantic_funcions_saida 		 [3][103]		=		default_action;
	semantic_funcions_saida 		 [3][104]		=		default_action;
	semantic_funcions_saida 		 [3][105]		=		default_action;
	semantic_funcions_saida 		 [3][106]		=		default_action;
	semantic_funcions_saida 		 [3][107]		=		default_action;
}

//////////////////////////////////////////////////////////
